import { _decorator, Component, v3, Node, Enum, color } from 'cc';
const { ccclass, property } = _decorator;


export const PartPos = {
    "Box1": v3(-0.057, 0.062, 0.184),
    "Box2": v3(0, 0.062, 0.184),
    "Box3": v3(0.056, 0.062, 0.184),
    "Box4": v3(-0.057, 0.062, 0.127),
    "Box5": v3(0, 0.062, 0.127),
    "Box6": v3(0.056, 0.062, 0.127),
    "Box7": v3(-0.057, 0.062, 0.067),
    "Box8": v3(0, 0.062, 0.067),
    "Box9": v3(0.056, 0.062, 0.067),
}

export const Group = {
    "DEFAULT": 1 << 0,
    "Box": 1 << 1,
    "WeaponPart": 1 << 2,
    "Weapon": 1 << 3,
    "Barrier": 1 << 4,
    "Bullet": 1 << 5,
}

export enum PARTGRADE {
    GRADE0,
    GRADE1,
    GRADE2,
    GRADE3,
    GRADE4,
    GRADE5,
    GRADE6,
    GRADE7,
    GRADE8,
    GRADE9,
}

export enum ITEMTYPE {
    PF,
    GC,
    GS,
}

export enum NUMBER {
    NUMBER1,
    NUMBER2,
    NUMBER3,
    NUMBER4,
    NUMBER5,
    NUMBER6,
    NUMBER7,
    NUMBER8,
    NUMBER9,
    NUMBER10,
    NUMBER11,
    NUMBER12,
}

export enum PART {
    XYQ = 0,
    QT = 1,
    DJ = 2,
    MZQ = 3,
}

export enum BUYTYPE {
    GOLD,
    VIDEO,
}

export enum WEAPONTYPE {
    手枪,
    UZI,
    散弹枪,
    汤姆逊,
    突击步枪,
}

/**
 * 零件最高等级
 */
export const PartMaxGrade = {
    "手枪": PARTGRADE.GRADE3,
    "UZI": PARTGRADE.GRADE5,
    "散弹枪": PARTGRADE.GRADE5,
    "汤姆逊": PARTGRADE.GRADE5,
    "突击步枪": PARTGRADE.GRADE5,
}


/**
 * 零件升级所需要的等级
 */
export const PartUpgrade = {
    "手枪": [PARTGRADE.GRADE1, PARTGRADE.GRADE2, PARTGRADE.GRADE3],
    "UZI": [PARTGRADE.GRADE1, PARTGRADE.GRADE3, PARTGRADE.GRADE5],
    "散弹枪": [PARTGRADE.GRADE1, PARTGRADE.GRADE3, PARTGRADE.GRADE5],
    "汤姆逊": [PARTGRADE.GRADE1, PARTGRADE.GRADE3, PARTGRADE.GRADE5],
    "突击步枪": [PARTGRADE.GRADE1, PARTGRADE.GRADE3, PARTGRADE.GRADE5],
}


export enum WEAPONPROPERTY {
    POWER = "POWER",
    RATE = "RATE",
    RANGE = "RANGE",
}

/**
 * 武器初始属性
 */
// export const weaponProperty = {
//     "手枪": {
//         "POWER": 1,
//         "RATE": 10,
//         "RANGE": 10,
//     },
//     "UZI": {
//         "POWER": 2,
//         "RATE": 22,
//         "RANGE": 12,
//     },
//     "散弹枪": {
//         "POWER": 3,
//         "RATE": 15,
//         "RANGE": 15,
//     },
//     "汤姆逊": {
//         "POWER": 5,
//         "RATE": 25,
//         "RANGE": 16,
//     },
//     "突击步枪": {
//         "POWER": 10,
//         "RATE": 35,
//         "RANGE": 20,
//     },
// }
export const weaponProperty = {
    "手枪": {
        power: 1,
        rate: 10,
        range: 10,
    } as WeaponData,
    "UZI": {
        power: 2,
        rate: 22,
        range: 12,
    } as WeaponData,
    "散弹枪": {
        power: 3,
        rate: 15,
        range: 15,
    } as WeaponData,
    "汤姆逊": {
        power: 5,
        rate: 25,
        range: 16,
    } as WeaponData,
    "突击步枪": {
        power: 10,
        rate: 35,
        range: 20,
    } as WeaponData,
}


/**
 * 武器零件增幅效果----消音器-枪托-弹夹-瞄准镜 ---攻速/攻击范围
 */
export const PartProperty = {
    "手枪": [[1.6, 2.1], [1.6, 1.6], [2.1, 1.3], [1.6, 1.6]],
    // "UZI": [[3.2, 3.2], [3.2, 3.2], [3.2, 3.2], [3.2, 3.2]],
    "UZI": [[1.6, 2.1], [1.6, 1.6], [2.1, 1.3], [1.6, 1.6]],
    "散弹枪": [[1.6, 2.1], [1.6, 1.6], [2.1, 1.3], [1.6, 1.6]],
    "汤姆逊": [[1.6, 2.1], [1.6, 1.6], [2.1, 1.3], [1.6, 1.6]],
    "突击步枪": [[1.6, 2.1], [1.6, 1.6], [2.1, 1.3], [1.6, 1.6]],
}

export const PathName = ["路7", "路10", "路13", "路16", "路19", "路22", "路25", "路28", "路31", "路34", "路37", "路40", "路43", "路46", "路49", "路52"];

export enum LV {
    LV1,
    LV2,
    LV3,
    LV4,
    LV5,
    LV6,
    LV7,
    LV8,
    LV9,
    LV10,
    LV11,
    LV12,
    LV13,
    LV14,
    LV15,
    LV16,
    LV17,
    LV18,
    LV19,
    LV20,
    LV21,
    LV22,
    LV23,
    LV24,
    LV25,
    LV26,
    LV27,
    LV28,
    LV29,
    LV30,
    LV31,
    LV32,
    LV33,
    LV34,
    LV35,
    LV36,
    LV37,
    LV38,
    LV39,
    LV40,
    LV41,
    LV42,
    LV43,
    LV44,
    LV45,
    LV46,
    LV47,
    LV48,
    LV49,
    LV50,
    LV51,
    LV52,
    LV53,
    LV54,
    LV55,
    LV56,
    LV57,
    LV58,
    LV59,
}


/**
 * 颜色枚举 -- rgba跟ColorRGBA对应
 */
export enum ContentColor {
    /**黑色 */
    BLACK,
    /**白色 */
    WHITE,
    /**蓝色 */
    Blue,
    /**深红色 */
    Crimson,
    /**绿色 */
    Green,
    /**靛蓝色 */
    Indigo,
    /**粉色 */
    Pink,
    /**红色 */
    Red,
    /**黄色 */
    Yellow
}

/**
 * 颜色rgba-- rgba跟ContentColor枚举对应
 */
export const ColorRGBA = [
    color(0, 0, 0, 255),
    color(255, 255, 255, 255),
    color(0, 0, 255, 255),
    color(220, 20, 60, 255),
    color(0, 255, 0, 255),
    color(75, 0, 130, 255),
    color(255, 192, 203, 255),
    color(255, 0, 0, 255),
    color(255, 255, 0, 255),
]

/**
 * 敌人的移动模式
 */
export enum ENEMYPATTERN {
    STAND,
    MOVE,
}

/**
 * 门的类型
 */
export enum DOOR {
    GREEN,
    RED,
    BLUE,
}
export enum AMPLIFICATION {
    RATE,
    RANGE,
}
export const Amplification = ["速度", "范围"];

export type WeaponData = {
    power: number,
    rate: number,
    range: number,
}

export const LastLV = {
    "手枪": LV.LV11,
    "UZI": LV.LV21,
    "散弹枪": LV.LV31,
    "汤姆逊": LV.LV41,
    "突击步枪": LV.LV51,
}



